<?php
namespace Utils;
use Utils;
use Model\Talking;
require_once __DIR__."/../Model/Talking.php";

class TalkUtils {
    //put your code here
     public static function Create($data) {
        
        $data["date"]= date("y-m-d h:i:s");
        $temp=new \Model\Talking($data);
       if($temp->add())
        {
            return (array)$temp;
        }
        else
            return array("code"=>400);
    }
    public static function fresh() {
       
        return \Model\Talking::get(0, 10);
    }
    public static function loadmore($from){
         return \Model\Talking::get($from, $from+10);
    }

    public static function clear(){
        $time=date("Y-m-d H:i:s",strtotime("-3 day"));
    }
}

